#ifndef TYPES_H
#define TYPES_H


/* @(#)types.h	1.2.3 2006/04/03 */

/*
 * these are mappings from logical to physical types
 */

typedef unsigned char	byte;	/* 1 byte : general type */
typedef unsigned short	ushort;	/* 2 byte : general type */
typedef unsigned int	uint;	/* 4 byte : general type */
typedef unsigned long	ulong;	/* 4 byte : general type */

// Op linux geeft de volgende typedef problemen
// omdat een soortgelijke ook op systeem niveau
// bestaat.  Gelukkig is die andere definitie
// ook 4 bytes groot.
//#ifndef	__daddr_t_defined
//typedef long	daddr_t;  	/* 4 byte : disk address */
//#endif
typedef ushort	ino_x;     	/* 2 byte : i-node number */
#ifndef	__time_t_defined
typedef long	time_t;   	/* 4 byte : time in seconds */
#endif
typedef short	dev_x;		/* 2 byte : device code */
typedef long	off_x;    	/* 4 byte : offset in file */
typedef ushort	id_x;		/* 2 byte : identification type */
typedef ushort	imode_t;	/* 2 byte : type of i_mode */

#ifndef BYTE
    #define BYTE 1
#endif

#ifndef USHORT
    #define USHORT 2
#endif

#ifndef UINT
    #define UINT 4
#endif

#ifndef ULONG
    #define ULONG 4
#endif

unsigned long readUnsignedInteger(unsigned char* data, int bytes);
void writeUnsignedInteger(unsigned char* data, int bytes, unsigned long value);
//string getchars(unsigned char* data, int offset, int count );

#endif /*TYPES_H*/
